package cn.itlaobing.web.utils;

import cn.itlaobing.web.entity.SystemRole;
import cn.itlaobing.web.entity.SystemUser;

import javax.servlet.http.HttpServletRequest;
import java.util.Set;

/*
*
* 权限分配工具类
* */
public class AssignpermissionsUtil {

    //分配权限
    public SystemUser assignPer(SystemUser user){
        Set<SystemRole> roles = user.getRoles();
        for (SystemRole role:roles) {
            user.setPermissions(role.getPermissions());
        }
        return user;
    }

}
